//简单工厂模式第四步：通过类CarFactory来管理各种实现接口Car的类
package thread.singleton.watson;

public class CarFactory {
	public static Car creator (String carType){
		
		if(carType.equals("Benz")){
			return new Benz();
		}else if(carType.equals("Bmw")){
			return new Bmw();
		}else{
			return null;
		}
	}

}
